import { NgModule,SkipSelf,Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule }   from '@angular/router';
import { FormsModule }   from '@angular/forms';
import { TreeModule, DataTableModule,SharedModule,RadioButtonModule,PasswordModule} from 'primeng/primeng';
//import { RadioButtonModule } from './../../../node_modules/primeng/radiobutton';
// import { PaginationModule } from 'ngx-bootstrap/pagination';
import { CoreModule } from '../core/core.module';
import { PublicModule } from '../public/public.module';
import { BsDatepickerModule }  from 'ngx-bootstrap/datepicker';
import {MatButtonModule,MatInputModule,MatCheckboxModule} from '@angular/material';

import { SidebarModule } from '../sidebar/sidebar.module';
import { UserComponent } from './user.component';
import { RoleComponent } from './role/role.component';
import { RolesComponent} from './roles/roles.component';
import { ManagementComponent } from '../../app/user/management/management.component';
import { PrivilegeComponent } from './privilege/privilege.component';
import { InstitutionComponent } from './institution/institution.component';
import { RolesAddComponent } from './roles/roles-add/roles-add.component';
import { RolesDetailsComponent } from './roles/roles-details/roles-details.component';

import { InstitutionService }from './services/institution.service';
import { EffectService }from './services/effect.service';
import { RoleAddComponent } from './role/role-add/role-add.component';
import { RoleDetailsComponent } from './role/role-details/role-details.component';

import { PrivilegeTableComponent } from './privilege/privilege-table/privilege-table.component';
import { PrivilegeEditComponent } from './privilege/privilege-edit/privilege-edit.component';
import { PrivilegeDetailsComponent } from './privilege/privilege-details/privilege-details.component';
import { PrivilegeNewlyAddedComponent } from './privilege/privilege-newly-added/privilege-newly-added.component';
import { PrivilegeDeleteComponent } from './privilege/privilege-delete/privilege-delete.component';

import { DragulaModule } from 'ng2-dragula';
import { RoleDeleteComponent } from './role/role-delete/role-delete.component';
import { RoleRolebyComponent } from './role/role-roleby/role-roleby.component';
import { RolesDeleteComponent } from './roles/roles-delete/roles-delete.component';
import { RolesTableComponent } from './roles/roles-table/roles-table.component';

import { EffectComponent  } from '../../app/user/effect/effect.component';
import { EffectAddComponent  } from '../../app/user/effect/effect-add/effect-add.component';
import { EffectDeleteComponent  } from '../../app/user/effect/effect-delete/effect-delete.component';
import { EffectDetailsComponent  } from '../../app/user/effect/effect-details/effect-details.component';
import { EffectPermissionComponent  } from '../../app/user/effect/effect-permission/effect-permission.component';
import { EffectTableComponent  } from '../../app/user/effect/effect-table/effect-table.component';
import { EffectUpdateComponent  } from '../../app/user/effect/effect-update/effect-update.component';
import { InstitutionAddComponent } from './institution/institution-add/institution-add.component';
import { InstitutionUpdateComponent } from './institution/institution-update/institution-update.component';
import { InstitutionDetailsComponent } from './institution/institution-details/institution-details.component';
import { InstitutionDeleteComponent } from './institution/institution-delete/institution-delete.component';
import { InstitutionTableComponent } from './institution/institution-table/institution-table.component';


//import { ManagementComponent  } from '../../app/user/management/management.component';
import { ManagementTableComponent } from '../../app/user/management/management-table/management-table.component';
import { InstitutionAddIpComponent } from './institution/institution-add-ip/institution-add-ip.component';
import { InstitutionAddAdminComponent } from './institution/institution-add-admin/institution-add-admin.component';
import { ManagementAddComponent } from './management/management-add/management-add.component';
import { ManagementDeleteComponent } from './management/management-delete/management-delete.component';
import { ManagementDetailsComponent } from './management/management-details/management-details.component';
import { ManagementUpdateComponent } from './management/management-update/management-update.component';
import { ManagementUpdatePasswordComponent } from './management/management-update-password/management-update-password.component';
import { ManagementUpdatePasswordresetComponent } from './management/management-update-passwordreset/management-update-passwordreset.component';
import { RoleTableComponent } from './role/role-table/role-table.component';
import {RoleLimitComponent} from "./role/role-limit/role-limit.component";
import { InstitutionDisableComponent } from './institution/institution-disable/institution-disable.component';
import { ManagementSearchComponent } from './management/management-search/management-search.component';
import { RoleLimitTreeComponent } from './role/role-limit-tree/role-limit-tree.component';
import { RoleRolebyLeftComponent } from './role/role-roleby-left/role-roleby-left.component';
import { RoleRolebyRightComponent } from './role/role-roleby-right/role-roleby-right.component';
import { from } from 'rxjs';
import { ManagementTheComponent } from './management/management-the/management-the.component';
import { InstitutionOfComponent } from './institution/institution-of/institution-of.component';
import { PublicTabUserComponent } from './public-tab-user/public-tab-user.component';
//import { ManagementEditComponent } from '../../app/user/management/management-edit/management-edit.component';
//import { ManagementDetailsComponent } from '../../app/user/management/management-details/management-details.component';
//import { ManagementNewlyAddedComponent } from '../../app/user/management/management-newly-added/management-newly-added.component';
//import { ManagementDeleteComponent } from '../../app/user/management/management-delete/management-delete.component';
// import {RadioButtonModule} from 'primeng/primeng';

@NgModule({
  imports: [
    CommonModule,
    RouterModule,
    CoreModule,
    SidebarModule,
    FormsModule,
    TreeModule,
    PasswordModule,
    DragulaModule,
    PublicModule,
    MatButtonModule,
    BsDatepickerModule,
    RadioButtonModule,
    MatCheckboxModule
  ],
  declarations: [
    UserComponent,
    RoleComponent,
    RolesComponent,
    ManagementComponent,
    PrivilegeComponent,
    InstitutionComponent,
    RolesAddComponent,
    RolesDetailsComponent,
    RoleAddComponent,
    RoleDetailsComponent,
    PrivilegeTableComponent,
    PrivilegeEditComponent,
    PrivilegeDetailsComponent,
    PrivilegeNewlyAddedComponent,
    PrivilegeDeleteComponent,
    RoleDeleteComponent,
    RoleRolebyComponent,
    RolesDeleteComponent,
    RolesTableComponent,
    EffectComponent,
    EffectAddComponent,
    EffectDeleteComponent,
    EffectDetailsComponent,
    EffectPermissionComponent,
    EffectTableComponent,
    EffectUpdateComponent,
    ManagementTableComponent,
    InstitutionAddComponent,
    InstitutionUpdateComponent,
    InstitutionDetailsComponent,
    InstitutionDeleteComponent,
    InstitutionTableComponent,
    EffectUpdateComponent,
    InstitutionAddIpComponent,
    InstitutionAddAdminComponent,
    ManagementAddComponent,
    ManagementDeleteComponent,
    ManagementDetailsComponent,
    ManagementUpdateComponent,
    ManagementUpdatePasswordComponent,
    ManagementUpdatePasswordresetComponent,
    RoleTableComponent,
    RoleLimitComponent,
    InstitutionDisableComponent,
    ManagementSearchComponent,
    RoleLimitTreeComponent,
    RoleRolebyLeftComponent,
    RoleRolebyRightComponent,
    ManagementTheComponent,
    InstitutionOfComponent,
    PublicTabUserComponent,
  ],
  exports:[
    UserComponent,
    RoleComponent,
    RolesComponent,
    ManagementComponent,
    PrivilegeComponent,
    InstitutionComponent,
    RolesAddComponent,
    RolesDetailsComponent,
    RoleAddComponent,
    RoleDetailsComponent,
    PrivilegeTableComponent,
    PrivilegeEditComponent,
    PrivilegeDetailsComponent,
    PrivilegeNewlyAddedComponent,
    PrivilegeDeleteComponent,
    RolesDetailsComponent,
    PrivilegeComponent,
    RoleDeleteComponent,
    RoleRolebyComponent,
    RolesTableComponent,
    EffectComponent,
    EffectAddComponent,
    EffectDeleteComponent,
    EffectDetailsComponent,
    EffectPermissionComponent,
    EffectTableComponent,
    EffectUpdateComponent,
    ManagementTableComponent,
  ],
  providers: [InstitutionService,EffectService]
})
export class UserModule {
  constructor(@Optional() @SkipSelf() parent:UserModule){
    if(parent){
      throw new Error('user模块已经加载，不要再次加载')
    }
  }
}
